home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 2002 November
/
SGI Freeware 2002 November - Disc 3.iso
/
dist
/
fw_qt3.idb
/
usr
/
freeware
/
Qt
/
examples
/
trayicon
/
trayicon.h.z
/
trayicon.h
Wrap
C/C++ Source or Header
|
2002-04-08
|
1KB
|
63 lines
#ifndef TRAYICON_H
#define TRAYICON_H
#ifndef QT_H
#include <qobject.h>
#include <qimage.h>
#endif // QT_H
class QPopupMenu;
class TrayIcon : public QObject
{
Q_OBJECT
Q_PROPERTY( QString toolTip READ toolTip WRITE setToolTip )
Q_PROPERTY( QPixmap icon READ icon WRITE setIcon )
public:
TrayIcon( QObject *parent = 0, const char *name = 0 );
TrayIcon( const QPixmap &, const QString &, QPopupMenu *popup = 0, QObject *parent = 0, const char *name = 0 );
~TrayIcon();
// Set a popup menu to handle RMB
void setPopup( QPopupMenu * );
QPopupMenu* popup() const;
QPixmap icon() const;
QString toolTip() const;
public slots:
void setIcon( const QPixmap &icon );
void setToolTip( const QString &tip );
void show();
void hide();
signals:
void clicked( const QPoint& );
void doubleClicked( const QPoint& );
protected:
bool event( QEvent * );
virtual void mouseMoveEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent *e );
virtual void mouseReleaseEvent( QMouseEvent *e );
virtual void mouseDoubleClickEvent( QMouseEvent *e );
private:
QPopupMenu *pop;
QPixmap pm;
QString tip;
// system-dependant part
class TrayIconPrivate;
TrayIconPrivate *d;
void sysInstall();
void sysRemove();
void sysUpdateIcon();
void sysUpdateToolTip();
};
#endif //TRAYICON_H